package com.prs.crm.dao.oa.impl;

import java.util.Collection;

import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.context.Constrains;
import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.oa.MemoDao;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.Memo;

public class MemoDaoImpl extends BaseDaoImpl<Memo> implements MemoDao{

	@Override
	public Collection<Memo> getUndealMemo(Person person) {
		// TODO Auto-generated method stub
		Criteria criteria = this.getSession().createCriteria(Memo.class);
		criteria.addOrder(Order.desc("recordTime"));
		criteria.add(Restrictions.eq("state", Constrains.MEMO_NOTDEAL));
		criteria.add(Restrictions.eq("recorder", person));
		return criteria.list();
	}

}
